Skip to content

Add line_spacing property and change (0,0) definition #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Mar 12, 2019

Conversation

ladyada
Copy link
Member

@ladyada ladyada commented Mar 2, 2019

the origin point of text areas is from the baseline of the font rather than the font's bounding box corner - that way changing fonts will not change the location of the text, only size and style

see this for definition of font baseline
https://printingpartners.files.wordpress.com/2017/12/font-diagram.png

see pygame which does the same (i think) https://nerdparadise.com/programming/pygame/part5

@tannewt its a breaking change so i'd like to do this soon if you're OK with it

@ladyada
Copy link
Member Author

ladyada commented Mar 10, 2019

@tannewt this is the new version with center-M origin

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs one additional comment. Good otherwise. Thank you!

@ladyada
Copy link
Member Author

ladyada commented Mar 12, 2019

@tannewt i need to lint more

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment tweak. Otherwise it looks good.

class TextArea(displayio.Group):
"""An area displaying a string of textself.
class Label(displayio.Group):
"""An area displaying a string of textself. The origin point set by ``x`` and ``y``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""An area displaying a string of textself. The origin point set by ``x`` and ``y``
"""A label displaying a string of text. The origin point set by ``x`` and ``y``

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you!

@ladyada ladyada merged commit 329158c into adafruit:master Mar 12, 2019
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Mar 12, 2019
Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP3xxx to 1.0.3 from 1.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_MCP3xxx#13 from yoomy3/fix-MCP3008-differential

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyPortal to 2.0.0 from 1.0.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_PyPortal#13 from ladyada/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.0.0 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#5 from ladyada/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_INA260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants